package com.learn.xueer.ui.activity

import android.os.Bundle
import com.blankj.utilcode.util.AppUtils
import com.learn.xueer.app.base.BaseActivity
import com.learn.xueer.app.ext.showMessage
import com.learn.xueer.app.util.CacheUtil

import com.learn.xueer.databinding.ActivityCancelExplainBinding
import com.learn.xueer.ui.viewmodel.MineViewModel

/**
 * 撤销同意声明
 */
class CancelExplainActivity : BaseActivity<MineViewModel, ActivityCancelExplainBinding>() {


    inner class ProxyClick {
        fun back() {
            finish()
        }

        fun cancel() {
            showMessage(
                "您需同意《隐私保护声明》方可使用本软件中的产品和服务，如果撤销，将直接退出app.",
                "尊敬的用户",
                "撤销并退出APP",
                {
                    CacheUtil.clearAll()
                    AppUtils.exitApp()
                },
                "不撤销",
                {})
        }


    }

    override fun initView(savedInstanceState: Bundle?) {
        mDatabind.click = ProxyClick()
        mDatabind.viewmodel = mViewModel

//        CacheDataManager.clearAllCache(this@ClearCacheActivity)
//        ToastUtils.showShort("清除缓存成功")
    }
}